package com.santiao.youxiang.ui.activity

import android.content.Context
import android.content.Intent
import android.os.Bundle
import android.view.View
import com.santiao.youxiang.R
import com.santiao.youxiang.base.BaseActivity
import com.santiao.youxiang.ext.thrillClickListener
import com.gyf.immersionbar.ImmersionBar
import com.santiao.publics.ui.SettingFragment
import com.santiao.youxiang.databinding.ActivityWebviewSgNbBinding

/**
 * date :   2023-12-28 028
 * author:  DengZhiYang
 * desc:    something
 */
class RYContentWebViewActivity : BaseActivity() {
    companion object {

        fun forward(context: Context, url: String, title: String) {
            context.startActivity(Intent(context, RYContentWebViewActivity::class.java).apply {
                putExtra("url",url)
                putExtra("title",title)
            })
        }

    }


    private lateinit var binding: ActivityWebviewSgNbBinding

    override fun getLayoutId() = R.layout.activity_webview_sg_nb

    override fun initView(view: View, savedInstanceState: Bundle?) {
        binding = ActivityWebviewSgNbBinding.bind(view)
        binding.ivSgadBack.thrillClickListener { finish() }
        binding.ivWebClose.thrillClickListener {
            finish()
        }
        binding.tvSgadTitle.text = intent.getStringExtra("title")
        binding.webView.loadUrl(intent.getStringExtra("url")!!)


        SettingFragment.adLoad(1,this.getString(R.string.feed_native_media_id),binding.flContent,this,this)
    }



    override fun onResume() {
        super.onResume()
        ImmersionBar.with(this)
            .statusBarColor(R.color.white)
            .titleBarMarginTop(binding.mainTop)
            .init()
    }
}